package com.jcl.recruit.elasticsearch.resume.dao;

import com.jcl.core.constants.Constant;
import com.jcl.core.db.DatabaseContext;
import com.jcl.recruit.elasticsearch.mapper.ConsoleReportSearchResumeMapper;
import com.jcl.recruit.elasticsearch.resume.vo.ElasticReportCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ConsoleReportSearchResumeDao
 * @Author yyliu
 * @Date 2018/12/25 14:51
 * @Version 1.0
 **/
@Component
public class ConsoleReportSearchResumeDao implements ConsoleReportSearchResumeMapper {

    @Autowired
    private ConsoleReportSearchResumeMapper consoleReportSearchResumeMapper;

    // 饼图
    @Override
    public List<Map<String, Object>> pieChar(ElasticReportCondition condition) {
        DatabaseContext.setServerName(Constant.ELASTIC_DB_NAME);
        return consoleReportSearchResumeMapper.pieChar(condition);
    }

    // 柱状图
    @Override
    public List<Map<String, Object>> barGraph(ElasticReportCondition condition) {
        DatabaseContext.setServerName(Constant.ELASTIC_DB_NAME);
        return consoleReportSearchResumeMapper.barGraph(condition);
    }
}
